//
//  StructureCell.m
//  New_Runway
//
//  Created by mack on 2018/2/8.
//  Copyright © 2018年 NelsonJ. All rights reserved.
//

#import "StructureCell.h"
@interface StructureCell ()
@property (weak, nonatomic) IBOutlet UILabel *carName;
@property (weak, nonatomic) IBOutlet UILabel *numL;
@property (weak, nonatomic) IBOutlet UILabel *scaleL;

@end
@implementation StructureCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}
-(void)setTotalNum:(CGFloat)totalNum{
    _totalNum = totalNum;
}
-(void)setIsType:(NSInteger)isType{
    _isType = isType;
}
-(void)setRankModel:(BranRankResult *)rankModel{
    _rankModel = rankModel;
    if (_isType == 0) {
        self.carName.text = rankModel.brandName;
    }else if (_isType == 1){
        self.carName.text = rankModel.seriesName;
    }else if (_isType == 2){
        self.carName.text = rankModel.carAgeRemark;
    }else if (_isType == 3){
        self.carName.text = rankModel.stockAgeRemark;
    }
    self.numL.text = [NSString stringWithFormat:@"%.0f",rankModel.storageNum];
    self.scaleL.text =  [NSString stringWithFormat:@"%.f%%",(rankModel.storageNum/_totalNum) * 100];
    
    
}

-(void)setSearchMode:(NSString *)searchMode{
    _searchMode = searchMode;
}
-(void)setCrmModel:(DataCrmResult *)crmModel{
    _crmModel = crmModel;
    
    if ([_searchMode isEqualToString:@"CHANNEL_ID"]) {
        self.carName.text = crmModel.channelName;
    }else{
        self.carName.text = crmModel.followerName;
    }
    self.numL.text = [NSString stringWithFormat:@"%.0f",crmModel.customerNum];
    self.scaleL.text =  [NSString stringWithFormat:@"%.f%%",(crmModel.customerNum/_totalNum) * 100];
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
